home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / AIncludes / SysEqu.a < prev    next >
Encoding:
Text File  |  1993-12-03  |  55.0 KB  |  1,432 lines  |  [TEXT/MPS ]

  1. ;    File:        SysEqu.a
  2. ;
  3. ;    Copyright:    © 1983-1993 by Apple Computer, Inc.
  4. ;                All rights reserved.
  5. ;
  6. ;    Version:    System 7.1• for ETO #13
  7. ;    Created:    Tuesday, March 30, 1993 18:00
  8. ;    Modified:    Tue, Nov 30, 1993 12:24:23
  9. ;
  10. ;___________________________________________________________________________
  11.  
  12.     IF &TYPE('__INCLUDINGSYSEQU__') = 'UNDEFINED' THEN
  13. __INCLUDINGSYSEQU__    SET    1
  14.  
  15.                   IF          (&TYPE('wholeSystem') = 'UNDEFINED') THEN
  16. wholeSystem       EQU         1
  17.                   ENDIF
  18.  
  19. ; miscellaneous stuff
  20. nil                EQU            0
  21. false            EQU            0
  22. true            EQU            1
  23.  
  24.  
  25.  
  26. ; ioFlags:
  27. noCacheBit        EQU             5                     ; disable cacheing for this operation  <S333/15Dec87>
  28. noCache            EQU          $20                 ; constant for noCacheBit   <S333/15Dec87>
  29.  
  30. PCDeskPat         EQU         $20B                      ; desktop pat, top bit only! others are in use
  31. HiKeyLast         EQU         $216                      ; Same as KbdVars
  32. KbdLast           EQU         $218                      ; Same as KbdVars+2
  33. ExpandMem         EQU         $2B6                      ; pointer to expanded memory block
  34.  
  35. ; Test Manager EQUs
  36. videoMagic        EQU         $5A932BC7                 ; When VideoInfoOk contains this value, the video card is ok (CritErr).
  37.  
  38. ; Unit table size constants (Used in startInit.a)
  39. unitEntries       EQU         64                        ; default # of entries in unit table
  40. maxUTEntries      EQU         unitEntries+64            ; Set Max higher so the table can grow.
  41. bgnSlotUnit       EQU         48                        ; default start unit number for slots.
  42. bgnSlotRef        EQU         -(bgnSlotUnit+1)          ; default start RefNum for slots.
  43.  
  44. ; Start Boot state constants.
  45. sbState0          EQU         0                         ; StartBoot code is at state-0.
  46. sbState1          EQU         1                         ; StartBoot code is at state-1.
  47.  
  48. ; system alarm
  49.  
  50. alrmFlEnable      EQU         0                         ; 1 => alarm clock mechanism is triggered
  51. ; Apple Desktop Bus
  52. JADBProc          EQU         1720                      ; (long) procedure called on ADBReInit
  53.  
  54. ; start at $C00
  55.  
  56. SCSIBase          EQU         $0C00                     ; (long) base address for SCSI chip read
  57. SCSI2Base          EQU         $1FF0                     ; (long) base address for 2nd SCSI chip            <?>
  58. SCSIDMA           EQU         $0C04                     ; (long) base address for SCSI DMA
  59. SCSIHsk           EQU         $0C08                     ; (long) base address for SCSI handshake
  60. SCSIGlobals       EQU         $0C0C                     ; (long) ptr for SCSI mgr locals
  61. RGBBlack          EQU         $0C10                     ; (6 bytes) the black field for color
  62. RGBWhite          EQU         $0C16                     ; (6 bytes) the white field for color
  63.  
  64. RowBits           EQU         $0C20                     ; (word) screen horizontal pixels
  65. ColLines          EQU         $0C22                     ; (word) screen vertical pixels
  66. ScreenBytes       EQU         $0C24                     ; (long) total screen bytes
  67.  
  68.  
  69. NMIFlag           EQU         $0C2C                     ; (byte) flag for NMI debounce
  70. VidType           EQU         $0C2D                     ; (byte) video board type ID
  71. ScrnInval        EQU            $0C2D                    ; (byte) replaces obscure VidType.  When $FFFF, scrn resource is
  72.                                                     ;        valid.  When cleared, scrn resource is invalid.
  73. VidMode           EQU         $0C2E                     ; (byte) video mode (4=4bit color)
  74. SCSIPoll          EQU         $0C2F                     ; (byte) poll for device zero only once.
  75.  
  76.  
  77. SEVarBase         EQU         $0C30                     ; ($0C30-0CB0) 128 bytes for sys err data
  78. ; note!!! - if changed, need to change also in hwequ file
  79.  
  80. MMUFlags          EQU         $0CB0                     ; (byte) cleared to zero (reserved for future use)
  81. MMUType           EQU         $0CB1                     ; (byte) kind of MMU present
  82. MMU32bit          EQU         $0CB2                     ; (byte) boolean reflecting current machine MMU mode
  83. MMUTbl            EQU         $0CB4                     ; (long) pointer to MMU Mapping table
  84. MMUTblSize        EQU         $0CB8                     ; (long) size of the 24 bit mode MMU mapping table
  85. MMU24Info         EQU         $0CB4                      ; (long) ptr to 24 bit mode MMU configuration info
  86. MMU32Info         EQU         $0CB8                     ; (long) ptr to 32 bit mode MMU configuration info
  87. SInfoPtr          EQU         $0CBC                     ; (long) pointer to Slot manager information
  88. ASCBase           EQU         $0CC0                     ; (long) pointer to Sound Chip
  89. SMGlobals         EQU         $0CC4                     ; (long) pointer to Sound Manager Globals
  90. TheGDevice        EQU         $0CC8                     ; (long) the current graphics device
  91. CQDGlobals        EQU         $0CCC                     ; (long) quickDraw global extensions
  92.  
  93. ; TEMPORARY EQUATE
  94. DeskCPat          EQU         $0CD8                     ; [PixPatHandle] Handle to desk pixPat
  95.  
  96. TimeVIADB         EQU         $0CEA                     ; (word) number of iter's of VIA access & DBRA.    <1.3>
  97. VIA2               EQU         $0CEC                     ; VIA2 base address [pointer]                    <2.7>
  98. RBV                EQU            VIA2                    ; RBV base address [pointer] share with VIA2    <2.7>
  99. VIA2RBV           EQU         VIA2                     ; VIA2 or RBV base address [pointer]            <1.3><2.7>
  100. OSS                EQU            VIA2                    ; OSS base address [pointer] share with VIA2    <2.7>
  101. VIA2RBVOSS       EQU         VIA2                     ; VIA2 or RBV or OSS base address [pointer]        <2.7>
  102. VISA            EQU            VIA2                    ; VISA base address [pointer]                    <11>
  103. V8                EQU            VIA2                    ; V8 base address [pointer]
  104.  
  105. WarmStart         EQU         $0CFC                     ; (long) flag to indicate it is a warm start
  106. wmStConst         EQU         $574C5343                 ; warm start constant
  107. sleepConst        EQU         'SARA'                    ; waking from sleep constant
  108. TimeDBRA          EQU         $0D00                     ; (word) number of iterations of DBRA per millisecond
  109. TimeSCCDB         EQU         $0D02                     ; (word) number of iter's of SCC access & DBRA.
  110.  
  111. PmgrBase          EQU         $0D18                      ; Lomem pointer to power manager vars
  112.  
  113. TableSeed         EQU         $0D20                     ; (long) seed value for color table ID's
  114. SRsrcTblPtr       EQU         $0D24                     ; (long) pointer to slot resource table.
  115. JVBLTask          EQU         $0D28                     ; vector to slot VBL task interrupt handler
  116. WMgrCPort         EQU         $0D2C                     ; window manager color port
  117. VertRRate         EQU         $0D30                     ; (word) Vertical refresh rate for start manager.
  118.  
  119. ChunkyDepth       EQU         $0D60                     ; depth of the pixels
  120. CrsrPtr           EQU         $0D62                     ; pointer to cursor save area
  121. PortList          EQU         $0D66                     ; list of grafports
  122. MickeyBytes       EQU         $0D6A                     ; long pointer to cursor stuff
  123. QDErr             EQU         $0D6E                     ; QuickDraw error code [word]
  124. VIA2DT            EQU         $0D70                     ; 32 bytes for VIA2 dispatch table for NuMac
  125.  
  126. SInitFlags        EQU         $0D90                     ; StartInit.a flags [word]
  127. DTQueue           EQU         $0D92                     ; (10 bytes) deferred task queue header
  128. DTQFlags          EQU         $0D92                     ; flag word for DTQueue
  129. DTskQHdr          EQU         $0D94                     ; ptr to head of queue
  130. DTskQTail         EQU         $0D98                     ; ptr to tail of queue
  131. JDTInstall        EQU         $0D9C                     ; (long) ptr to deferred task install routine
  132. HiliteRGB         EQU         $0DA0                     ; 6 bytes: rgb of hilite color
  133. DSCtrAdj          EQU         $0DA8                     ; (long) Center adjust for DS rect.
  134. IconTLAddr        EQU         $0DAC                     ; (long) pointer to where start icons are to be put.
  135. VideoInfoOK       EQU         $0DB0                     ; (long) Signals to CritErr that the Video card is ok
  136. EndSRTPtr         EQU         $0DB4                     ; (long) Pointer to the end of the Slot Resource Table (Not the SRT buffer).
  137. SDMJmpTblPtr      EQU         $0DB8                     ; (long) Pointer to the SDM jump table
  138. JSwapMMU          EQU         $0DBC                     ; (long) jump vector to SwapMMU routine
  139. SdmBusErr         EQU         $0DC0                     ; (long) Pointer to the SDM busErr handler
  140. LastTxGDevice     EQU         $0DC4                     ; (long) copy of TheGDevice set up for fast text measure
  141.  
  142. NewCrsrJTbl       EQU         $88C                      ; location of new crsr jump vectors
  143. NewCrsrJCnt       EQU         1                         ; 2 new vectors
  144. JAllocCrsr        EQU         $88C                      ; (long) vector to routine that allocates cursor
  145. JSetCCrsr         EQU         $890                      ; (long) vector to routine that sets color cursor
  146. JOpcodeProc       EQU         $894                      ; (long) vector to process new picture opcodes
  147. CRSRBASE          EQU         $898                      ; (long) scrnBase for cursor
  148. CrsrDevice        EQU         $89C                      ; (long) current cursor device
  149. SrcDevice         EQU         $8A0                      ; (LONG) Src device for Stretchbits
  150. MainDevice        EQU         $8A4                      ; (long) the main screen device
  151. DeviceList        EQU         $8A8                      ; (long) list of display devices
  152. CRSRROW           EQU         $8AC                      ; (word) rowbytes for current cursor screen
  153. QDColors          EQU         $8B0                      ; (long) handle to default colors
  154.  
  155. ; QuickDraw
  156.  
  157. HiliteMode        EQU         $938                      ; used for color highlighting
  158.  
  159. Point             RECORD    0
  160. v                 DS.W      1 ; short
  161. h                 DS.W      1 ; short
  162. size              EQU       *
  163.                   ENDR
  164.  
  165. Rect              RECORD    0
  166. top               DS.W      1
  167. left              DS.W      1
  168. bottom            DS.W      1
  169. right             DS.W      1
  170.                   ORG        top
  171. topLeft           DS        Point
  172. botRight          DS        Point
  173.                   ORG
  174. size              equ       *
  175.                   ENDR
  176.  
  177.  
  178. ; Exception vectors
  179.  
  180. ResetSP            EQU            $00                ; reset initial interrupt SP                     <32> rb
  181. ResetPC            EQU            $04                ; reset initial Program counter                    <32> rb
  182. BusErrVct         EQU         $08               ; bus error vector
  183. AddrVector        EQU            $C                ; address error
  184. IlglVector        EQU            $10                ; illegal instruction
  185. ZeroVector        EQU            $14                ; divide by 0
  186. CheckVector        EQU            $18                ; check bounds error
  187. TrapVVector        EQU            $1C                ; trapv location
  188. PrivlgVector    EQU            $20                ; privilege violation
  189. TraceVector        EQU            $24                ; trace exception vector
  190. Line1010          EQU         $28               ; 1010 emulator trap (system routines)
  191. Line1111          EQU         $2C               ; 1111 emulator trap (reserved)
  192. DebugVector        EQU            Line1111        ; debug instructions
  193. FmtErrVect        EQU         $38               ; format error vector for 68010/68020
  194. BadIntVector    EQU            $60                ; spurious interrupt
  195. AutoInt1          EQU         $64               ; level 1 auto-vector
  196. AutoInt2          EQU         $68               ; level 2 auto-vector
  197. AutoInt3          EQU         $6C               ; level 3 auto-vector
  198. AutoInt4          EQU         $70               ; level 4 auto-vector
  199. AutoInt5          EQU         $74               ; level 5 auto-vector
  200. AutoInt6          EQU         $78               ; level 6 auto-vector
  201. AutoInt7          EQU         $7C               ; level 7 auto-vector
  202. BkptVector        EQU            $B8                ; break loc
  203. BSUNVector        EQU            $C0                ; BSUN for FP Emulation Code                        <32> rb
  204. UNFLVector        EQU            $CC                ; Underflow for FP Emulation Code                    <32> rb
  205. OPERRVector        EQU            $D0                ; Operand Error for FP Emulation Code                <32> rb
  206. OVFLVector        EQU            $D4                ; Overflow for FP Emulation Code                    <32> rb
  207. SNANVector        EQU            $D8                ; Signal NAN for FP Emulation Code                    <32> rb
  208. UNIMPDTVector    EQU            $DC                ; 040 Unimplemented Data Type for FP Emulation Code    <32> rb
  209.  
  210. ;-------------
  211. ; MMU Equates
  212. ;-------------
  213.  
  214. ; MMU Mode bits
  215. ;
  216. ; type MMU_Mode = (true32b,false32b)
  217.  
  218. false32b          EQU         0                         ; modified
  219. true32b           EQU         1
  220.  
  221. ;+ System Error Handler
  222.  
  223. RestProc          EQU         $A8C                      ; Resume procedure f InitDialogs [pointer]
  224.  
  225. ; equates for queue elements
  226.  
  227. sIQType           EQU         6                         ; slot interrupt queue element ID
  228.  
  229. ;Default Startup
  230.  
  231. ;DefaultRec offsets for set/get default startup
  232.  
  233. drDriveNum        EQU         0                         ; [INTEGER]
  234. drRefNum          EQU         2                         ; [INTEGER]
  235.  
  236. ; Deferred Task Queue Element
  237.  
  238. dtQType           EQU         7                         ; deferred task queue element ID
  239. inDTQ             EQU         6                         ; bit index for "in deferred task" flag
  240. dtLink            EQU         0                         ; Link to next element [pointer]
  241. dtType            EQU         4                         ; Unique ID for validity [word]
  242. dtFlags           EQU         6                         ; optional flags [word]
  243. dtAddr            EQU         8                         ; service routine [pointer]
  244. dtParm            EQU         $C                        ; optional A1 parameter [long]
  245. dtResrvd          EQU         $10                       ; reserved [long]
  246. dtQElSize         EQU         20                        ; length of DT queue element in bytes
  247.  
  248.  
  249. ; Topanga video mode for Esprit
  250. NTSC               EQU         $B3E                      ; A byte                        <v2.1>
  251.  
  252.  
  253. ;+ ROM Equates
  254.  
  255. ROM85             EQU         $28E                      ; (word) actually high bit - 0 for ROM vers $75 (sic) and later
  256. ROMMapHndl        EQU         $B06                      ; (long) handle of ROM resource map
  257.  
  258. ;+ Screen Equates
  259.  
  260. ScrVRes           EQU         $102                      ; screen vertical dots/inch [word]
  261. ScrHRes           EQU         $104                      ; screen horizontal dots/inch [word]
  262. ScrnBase          EQU         $824                      ; Screen Base [pointer]
  263. ScreenRow         EQU         $106                      ; rowBytes of screen [word]
  264.  
  265.  
  266. ; Mouse/Keyboard
  267.  
  268. MBTicks           EQU         $16E                      ; tick count @ last mouse button [long]
  269. JKybdTask         EQU         $21A                      ; keyboard VBL task hook [pointer]
  270. KeyLast           EQU         $184                      ; ASCII for last valid keycode [word]
  271. KeyTime           EQU         $186                      ; tickcount when KEYLAST was rec'd [long]
  272. KeyRepTime        EQU         $18A                      ; tickcount when key was last repeated [long]
  273.  
  274. ;+ Parameter RAM (a twenty byte copy of the real parameter ram).
  275.  
  276. SPConfig          EQU         $1FB                      ; config bits: 4-7 A, 0-3 B (see use type below)
  277. SPPortA           EQU         $1FC                      ; SCC port A configuration [word]
  278. SPPortB           EQU         $1FE                      ; SCC port B configuration [word]
  279.  
  280. ; SCC Serial Chip Addresses
  281.  
  282. SCCRd             EQU         $1D8                      ; SCC base read address [pointer]
  283. SCCWr             EQU         $1DC                      ; SCC base write address [pointer]
  284.  
  285. ; Serial port use type
  286.  
  287. useFree           EQU         0                         ; Use undefined
  288. useATalk          EQU         1                         ; AppleTalk
  289. useAsync          EQU         2                         ; Async
  290. useExtClk         EQU         3                         ; externally clocked
  291.  
  292. ; Unpacked, user versions of parameter ram
  293.  
  294. DoubleTime        EQU         $2F0                      ; double click ticks [long]
  295. CaretTime         EQU         $2F4                      ; caret blink ticks [long]
  296. KeyThresh         EQU         $18E                      ; threshold for key repeat [word]
  297. KeyRepThresh      EQU         $190                      ; key repeat speed [word]
  298. SdVolume          EQU         $260                      ; Global volume(sound) control [byte]
  299.  
  300.  
  301. ;+ System Clocks
  302.  
  303. Ticks             EQU         $16A                      ; Tick count, time since boot [long]
  304. Time              EQU         $20C                      ; clock time (extrapolated) [long]
  305.  
  306.  
  307. ;+ Cursor
  308.  
  309. iBeamCursor       EQU         1                         ; text selection cursor
  310. crossCursor       EQU         2                         ; for structured selection
  311. plusCursor        EQU         3                         ; for drawing graphics
  312. watchCursor       EQU         4                         ; for indicating a long delay
  313.  
  314.  
  315. ; result codes for Relstring call
  316.  
  317. sortsBefore       EQU         -1                        ; str1 < str2
  318. sortsEqual        EQU         0                         ; str1 = str2
  319. sortsAfter        EQU         1                         ; str1 > str2
  320.  
  321. ;+ Queue Package
  322.  
  323. qInUse            EQU         7                         ; queue-in-use flag bit
  324.  
  325. ; Header Record
  326.  
  327. qHeadSize         EQU         $A                        ; queue header size
  328. qFlags            EQU         0                         ; miscellaneous flags [word]
  329. qHead             EQU         2                         ; first element in queue [pointer]
  330. qTail             EQU         6                         ; last element in queue [pointer]
  331.  
  332. ; General Purpose Queue Element Definition
  333.  
  334. qLink             EQU         0                         ; link to next queue element [pointer]
  335. qType             EQU         4                         ; queue element type [word]
  336.  
  337.  
  338. ;+ Event Manager
  339.  
  340. evType            EQU         4                         ; event queue element is type 4
  341.  
  342. ; Event Type Numbers (in EvtNum)
  343.  
  344. everyEvent        EQU         -1
  345. nullEvt           EQU         0                         ; event 0 is the null event
  346. mButDwnEvt        EQU         1                         ; mouse button down is event 1
  347. mButUpEvt         EQU         2                         ; mouse button up is event 2
  348. keyDwnEvt         EQU         3                         ; key down is event 3
  349. keyUpEvt          EQU         4                         ; key up is event 4
  350. autoKeyEvt        EQU         5                         ; auto-repeated key is event 5
  351. updatEvt          EQU         6                         ; update event
  352. diskInsertEvt     EQU         7                         ; disk-inserted event
  353. activateEvt       EQU         8                         ; activate/deactive event
  354. osEvt            EQU            $F                        ; suspend/resume/mousemoved
  355. kHighLevelEvent    EQU            $17                        ; high-level event
  356.  
  357. ; Event Mask Equates
  358. ; (same constant names are masks rather than bit numbers in higher level languages.
  359. ; Only special one is highLevelEvtBit, since it has only indirect correspondence to
  360. ; kHighLevelEvent. 
  361.  
  362. highLevelEvtBit    EQU            $A                        ; for kHighLevelEvent
  363.  
  364. ; Event Message Equates
  365.  
  366. charCodeMask          EQU         $000000FF
  367. keyCodeMask           EQU         $0000FF00
  368. adbAddrMask           EQU         $00FF0000
  369. osEvtMessageMask       EQU         $FF000000
  370.  
  371. ; osEvt Messages.  Event (sub)code is in the high byte of the message field.
  372. mouseMovedMessage        EQU     $FA ;
  373. suspendResumeMessage    EQU     $01 ;
  374. resumeFlag                EQU     0    ; Bit 0 of message field indicates resume vs suspend }
  375. convertClipboardFlag    EQU     1    ; Bit 1 in resume message indicates clipboard change }
  376.  
  377. ; Modifier bits in event record
  378. ; (same constant names are masks rather than bit numbers in higher level languages.)
  379.  
  380. activeFlag        EQU         $0                        ; activate? (activateEvt and mouseDown)
  381. btnState          EQU         $7                        ; state of button?
  382. cmdKey            EQU         $8                        ; command key down?
  383. shiftKey          EQU         $9                        ; shift key down?
  384. alphaLock         EQU         $A                        ; alpha lock down?
  385. optionKey         EQU         $B                        ; option key down?
  386. controlKey        EQU         $C                        ; control key down?
  387.  
  388. ; Event Record Definition
  389.  
  390. evtNum            EQU         0                         ; event code [word]
  391. evtMessage        EQU         2                         ; event message [long]
  392. evtTicks          EQU         6                         ; ticks since startup [long]
  393. evtMouse          EQU         $A                        ; mouse location [long]
  394. evtMeta           EQU         $E                        ; state of modifier keys [byte]
  395. evtMBut           EQU         $F                        ; state of mouse button [byte]
  396. evtBlkSize        EQU         $10                       ; size in bytes of the event record
  397. MonkeyLives       EQU         $100                      ; monkey lives if >= 0 [word]
  398. SEvtEnb           EQU         $15C                      ; enable SysEvent calls from GNE [byte]
  399. JournalFlag       EQU         $8DE                      ; journaling state [word]
  400. JournalRef        EQU         $8E8                      ; Journalling driver's refnum [word]
  401.  
  402. EventRecord          RECORD  0
  403. what                 DS.W    1  ; short
  404. message              DS.L    1  ; long
  405. when                 DS.L    1  ; long
  406. where                DS      Point
  407. modifiers            DS.W    1  ; short
  408. size                 EQU     *
  409.                      ENDR
  410.  
  411.  
  412. ; Obsolete Event Manager Equates
  413.  
  414. netWorkEvt        EQU         $A                        ; network event
  415. ioDrvrEvt         EQU         $B                        ; driver-defined event
  416. app1Evt           EQU         $C                        ; application defined events
  417. app2Evt           EQU         $D
  418. app3Evt           EQU         $E
  419. app4Evt           EQU         $F
  420.  
  421. ;+ Memory Manager
  422.  
  423. ; Master pointer bits for handles - USE _HLock, _HPurge, etc. for portability
  424.  
  425. lock              EQU         7                         ; lock bit in a master pointer
  426. purge             EQU         6                         ; bit for purgeable/unpurgeable
  427. resource          EQU         5                         ; bit to flag a resource handle
  428.  
  429.  
  430. BufPtr            EQU         $10C                      ; top of application memory [pointer]
  431. StkLowPt          EQU         $110                      ; Lowest stack as measured in VBL task [pointer]
  432. TheZone           EQU         $118                      ; current heap zone [pointer]
  433. ApplLimit         EQU         $130                      ; application limit [pointer]
  434. SysZone           EQU         $2A6                      ; system heap zone [pointer]
  435. ApplZone          EQU         $2AA                      ; application heap zone [pointer]
  436. HeapEnd           EQU         $114                      ; end of heap [pointer]
  437. HiHeapMark        EQU         $BAE                      ; (long) highest address used by a zone below sp
  438. MemErr            EQU         $220                      ; last memory manager error [word]
  439. maxSize           EQU         $800000                   ; outrageously large memory mgr request
  440. dfltStackSize     EQU         $00002000                 ; 8K size for stack
  441. mnStackSize       EQU         $00000400                 ; 1K minimum size for stack
  442.  
  443. ; _InitZone argument table.
  444.  
  445. startPtr          EQU         0                         ; Start address for zone [pointer]
  446. limitPtr          EQU         4                         ; Limit address for zone [pointer]
  447. cMoreMasters      EQU         8                         ; Number of masters to allocate at time [word]
  448. pGrowZone         EQU         10                        ; growZone procedure [pointer]
  449.  
  450. ; Control/Status Call Codes
  451.  
  452. killCode          EQU         1                         ; KillIO code
  453. drvStsCode        EQU         8                         ; status call code for drive status
  454. ejectCode         EQU         7                         ; control call eject code
  455. tgBuffCode        EQU         8                         ; set tag buffer code
  456.  
  457. ; Driver flags, (Bit definitions for DCtlFlags byte)
  458.  
  459. dReadEnable       EQU         0                         ; enabled for read operations
  460. dWritEnable       EQU         1                         ; enabled for writing
  461. dCtlEnable        EQU         2                         ; enabled for control operations
  462. dStatEnable       EQU         3                         ; enabled for status operations
  463. dNeedGoodBye      EQU         4                         ; needs a "goodbye kiss"
  464. dNeedTime         EQU         5                         ; needs "main thread" time
  465. dNeedLock         EQU         6                         ; needs to be accessed at interrupt level
  466.  
  467. ; Run-Time flags, (Bit definitions for DCtlFlags+1 byte)
  468.  
  469. dOpened           EQU         5                         ; bit to mark driver 'Open'
  470. dRAMBased         EQU         6                         ; 1=RAM-based Driver, 0=ROM-based
  471. drvrActive        EQU         7                         ; bit to mark the driver active
  472.  
  473. ; Drive queue element offsets
  474.  
  475. dQDrive           EQU         $6                        ; drive number [word]
  476. dQRefNum          EQU         $8                        ; driver refnum [word]
  477. dQFSID            EQU         $A                        ; file system handling this drive [word]
  478. dQDrvSz           EQU         $C                        ; number of blocks this drive [word]
  479. dQDrvSz2          EQU         $E                        ; if qType = 1, high word of drive size
  480.  
  481. ; Queue Element Type Definitions
  482.  
  483. ioQType           EQU         2                         ; I/O queue element is type 2
  484. drvQType          EQU         3                         ; timer queue element is type 3
  485. fsQType           EQU         5                         ; File System VCB element
  486. slpQType        EQU            $10                        ; Sleep queue element is type 16        <v1.2>
  487. btQType            EQU            21                        ; B*Tree Manager
  488.  
  489. ; Device Control Entry Definition
  490. ;dCtlEntrySize used to be only 40 bytes!
  491.  
  492. dCtlEntrySize     EQU         $34                       ; length of a DCE [52 bytes]
  493. dCtlDriver        EQU         0                         ; driver [handle]
  494. dCtlFlags         EQU         4                         ; flags [word]
  495. dCtlQueue         EQU         6                         ; queue header
  496. dCtlQHead         EQU         8                         ; queue first-element [pointer]
  497. dCtlQTail         EQU         $C                        ; queue last-element [pointer]
  498. dCtlPosition      EQU         $10                       ; position [long]
  499. dCtlStorage       EQU         $14                       ; driver's private storage [handle]
  500. dCtlRefNum        EQU         $18                       ; refNum of this driver [word]
  501. dCtlCurTicks      EQU         $1A                       ; counter for timing systemTask calls [long]
  502. dCtlWindow        EQU         $1E                       ; driver's window (if any) [pointer]
  503. dCtlDelay         EQU         $22                       ; number of ticks between sysTask calls [word]
  504. dCtlEMask         EQU         $24                       ; desk accessory event mask [word]
  505. dCtlMenu          EQU         $26                       ; menu ID associated with driver [word]
  506. dCtlSlot          EQU         $28                       ; device slot Number [byte]
  507. dCtlSlotId        EQU         $29                       ; device Id within slot [byte]
  508. dCtlDevBase       EQU         $2A                       ; driver scratch ptr/offset from base to device [long]
  509. dCtlOwner         EQU         $2E                       ; ptr to task control block(ownership) [Ptr]
  510. dCtlExtDev        EQU         $32                       ; Id of external device [byte]
  511.  
  512.  
  513. ; Driver Globals
  514.  
  515. UTableBase        EQU         $11C                      ; unit I/O table [pointer]
  516. UnitNtryCnt       EQU         $1D2                      ; count of entries in unit table [word]
  517. JFetch            EQU         $8F4                      ; fetch a byte routine for drivers [pointer]
  518. JStash            EQU         $8F8                      ; stash a byte routine for drivers [pointer]
  519. JIODone           EQU         $8FC                      ; IODone entry location [pointer]
  520.  
  521. ;Chooser
  522.  
  523. chooserID         EQU         1                         ; caller value for the chooser
  524.  
  525. ;+ I/O System
  526.  
  527. ; File positioning modes for ioPosMode field of I/O record
  528.  
  529. fsAtMark          EQU         0                         ; at current position of mark
  530. fsFromStart       EQU         1                         ; offset relative to beginning of file
  531. fsFromLEOF        EQU         2                         ; offset relative to logical end-of-file
  532. fsFromMark        EQU         3                         ; offset relative to current mark
  533. rdVerify          EQU         $40                       ; read verify mode
  534.  
  535. ; Permission values for ioPermssn field of I/O record
  536.  
  537. fsCurPerm         EQU         0                         ; whatever is currently allowed
  538. fsRdPerm          EQU         1                         ; request to read only
  539. fsWrPerm          EQU         2                         ; request to write only
  540. fsRdWrPerm        EQU         3                         ; request to read and write
  541. fsRdWrShPerm      EQU         4                         ; request for shared read and write
  542.  
  543. ; I/O record (general fields with trap-specific ones listed below)
  544.  
  545. ioQElSize         EQU         $32                       ; length of I/O parameter block [50 bytes]
  546. ioLink            EQU         $0                        ; queue link in header [pointer]
  547. ioType            EQU         $4                        ; type for safety check [byte]
  548. ioTrap            EQU         $6                        ; the trap [word]
  549. ioCmdAddr         EQU         $8                        ; address to dispatch to [pointer]
  550. ioCompletion      EQU         $C                        ; completion routine [pointer]
  551. ioResult          EQU         $10                       ; I/O result code [word]
  552. ioFileName        EQU         $12                       ; file name pointer [pointer]
  553. ioVRefNum         EQU         $16                       ; volume refnum [word]
  554. ioDrvNum          EQU         $16                       ; drive number [word]
  555. ioRefNum          EQU         $18                       ; file reference number [word]
  556. ioFileType        EQU         $1A                       ; specified along with FileName [byte]
  557.  
  558. ; specific fields for _Read, _Write
  559.  
  560. ioBuffer          EQU         $20                       ; data buffer [pointer]
  561. ioByteCount       EQU         $24                       ; requested byte count [long]
  562. ioNumDone         EQU         $28                       ; actual byte count completed [long]
  563. ioPosMode         EQU         $2C                       ; initial file positioning mode/eol char [word]
  564. ioPosOffset       EQU         $2E                       ; file position offset [long]
  565.  
  566. ; specific fields for _Allocate
  567.  
  568. ioReqCount        EQU         $24                       ; requested new size [long]
  569. ioActCount        EQU         $28                       ; actual byte count allocated [long]
  570.  
  571. ; specific fields for _Open
  572.  
  573. ioPermssn         EQU         $1B                       ; permissions [byte]
  574. ioOwnBuf          EQU         $1C                       ; "private" 522-byte buffer [pointer]
  575.  
  576. ; specific fields for _Rename
  577.  
  578. ioNewName         EQU         $1C                       ; new name pointer [pointer]
  579.  
  580. ; specific fields for _GetFileInfo, _SetFileInfo
  581.  
  582. ioFQElSize        EQU         $50                       ; File command parameter length [80 bytes]
  583. ioFDirIndex       EQU         $1C                       ; directory index of file [word]
  584. ioFlAttrib        EQU         $1E                       ; in-use bit=7, lock bit=0 [byte]
  585. ioFFlType         EQU         $1F                       ; file type [byte]
  586. ioFlUsrWds        EQU         $20                       ; finder info [16 bytes]
  587. ioFFlNum          EQU         $30                       ; file number [long]
  588. ioFlStBlk         EQU         $34                       ; start file block (0000 if none) [word]
  589. ioFlLgLen         EQU         $36                       ; logical length (EOF) [long]
  590. ioFlPyLen         EQU         $3A                       ; physical length in bytes [long]
  591. ioFlRStBlk        EQU         $3E                       ; resource fork's start file block [word]
  592. ioFlRLgLen        EQU         $40                       ; resource fork's logical length (EOF) [long]
  593. ioFlRPyLen        EQU         $44                       ; resource fork's physical length [long]
  594. ioFlCrDat         EQU         $48                       ; creation date & time [long]
  595. ioFlMdDat         EQU         $4C                       ; last modification date & time [long]
  596.  
  597. ; Specific fields for _GetEOF, _SetEOF
  598.  
  599. ioLEOF            EQU         $1C                       ; logical end-of-file [long]
  600.  
  601. ; Specific fields for _SetFileType
  602.  
  603. ioNewType         EQU         $1C                       ; new type byte [byte]
  604.  
  605. ; Specific fields for _GetVolInfo, _GetVolume, _SetVolume, _MountVol, _UnmountVol,
  606. ; _Eject. Note that these traps have a bigger record size.
  607.  
  608. ioVQElSize        EQU         $40                       ; Volume command parameter length [64 bytes]
  609. ioVDrvNum         EQU         $16                       ; drive or volume number [word]
  610. ioVNPtr           EQU         $12                       ; name buffer (or zero) [pointer]
  611. ioVolIndex        EQU         $1C                       ; volume index number [word]
  612. ioVCrDate         EQU         $1E                       ; creation date & time [long]
  613. ioVLsBkUp         EQU         $22                       ; last backup date & time [long]
  614. ioVAtrb           EQU         $26                       ; Volume attributes [word]
  615. ioVNmFls          EQU         $28                       ; # files in directory [word]
  616. ioVDirSt          EQU         $2A                       ; start block of file dir [word]
  617. ioVBlLn           EQU         $2C                       ; length of dir in blocks [word]
  618. ioVNmAlBlks       EQU         $2E                       ; num blks (of alloc size) this dev [word]
  619. ioVAlBlkSiz       EQU         $30                       ; alloc blk byte size [long]
  620. ioVClpSiz         EQU         $34                       ; bytes to try to allocate at a time [long]
  621. ioAlBlSt          EQU         $38                       ; starting block in block map [word]
  622. ioVNxtFNum        EQU         $3A                       ; next free file number [long]
  623. ioVFrBlk          EQU         $3E                       ; # free alloc blks for this vol [word]
  624.  
  625. ; Catalog structure equates:
  626.  
  627. fsRtParID         EQU         1                         ; DirID of parent's root
  628. fsRtDirID         EQU         2                         ; Root DirID
  629. fsXTCNID          EQU         3                         ; Extent B*-Tree file ID
  630. fsCTCNID          EQU         4                         ; Catalog B*-Tree file ID
  631. fsBBCNID        EQU            5                        ; Bad Block "file" ID
  632. fsUsrCNID         EQU         $10                       ; First assignable user CNode ID
  633.  
  634. ; Additional equates for all calls:
  635.  
  636. ioDirID           EQU         $30                       ; directory ID
  637. ioHQElSize        EQU            $34                        ; size of a standard HFS call queue element
  638.  
  639. ; Additional equates for catalog information return:
  640.  
  641. ioFlBkDat         EQU         $50                       ; File's last backup date
  642. ioFlxFndrInfo     EQU         $54                       ; File's additional finder info bytes
  643. ioFlParID         EQU         $64                       ; File's parent directory ID
  644. ioFlClpSiz        EQU         $68                       ; File's clump size, in bytes
  645.  
  646. ; Additional equates for directory information return:
  647.  
  648. ioDirFlg          EQU         4                         ; Bit in ioFlAttrb set to indicate directory
  649. ioDrUsrWds        EQU         $20                       ; Directory's user info bytes
  650. ioDrDirID         EQU         $30                       ; Directory ID
  651. ioDrNmFls         EQU         $34                       ; Number of files in a directory
  652. ioDrCrDat         EQU         $48                       ; Directory creation date
  653. ioDrMdDat         EQU         $4C                       ; Directory modification date
  654. ioDrBkDat         EQU         $50                       ; Directory backup date
  655. ioDrFndrInfo      EQU         $54                       ; Directory finder info bytes
  656. ioDrParID         EQU         $64                       ; Directory's parent directory ID
  657. ioHFQElSiz        EQU         $6C                       ; Size of a Hierarchical File Queue Element
  658.  
  659. ; Additional equates for _TFGetVolInfo:
  660.  
  661. ioVLsMod          EQU         $22                       ; Last modification date
  662. ioVSigWord        EQU         $40                       ; Volume signature
  663. ioVCBVBMst        EQU         $2A
  664. ioVNxtCNID        EQU         $3A
  665. ioVDrvInfo        EQU         $42                       ; Drive number (0 if volume is offline)
  666. ioVDRefNum        EQU         $44                       ; Driver refNum
  667. ioVFSID           EQU         $46                       ; ID of file system handling this volume
  668. ioVBkup           EQU         $48                       ; Last backup date (0 if never backed up)
  669. ioVSeqNum         EQU         $4C                       ; Sequence number of this volume in volume set
  670. ioVWrCnt          EQU         $4E                       ; Volume write count
  671. ioVFilCnt         EQU         $52                       ; Total number of files on volume
  672. ioVDirCnt         EQU         $56                       ; Total number of directories on the volume
  673. ioVFndrInfo       EQU         $5A                       ; Finder information for volume
  674. ioHVQElSize       EQU         $7A                       ; Length of Hierarchical Volume information PB
  675.  
  676. ; fields for _GetFCBInfo:
  677.  
  678. ioFCBIndx         EQU         $1C                       ; FCB index for _GetFCBInfo
  679. ioFCBFiller1      EQU         $1E                       ; filler
  680. ioFCBFlNm         EQU         $20                       ; File number
  681. ioFCBFlags        EQU         $24                       ; FCB flags
  682. ioFCBStBlk        EQU         $26                       ; File start block
  683. ioFCBEOF          EQU         $28                       ; Logical end-of-file
  684. ioFCBPLen         EQU         $2C                       ; Physical end-of-file
  685. ioFCBCrPs         EQU         $30                       ; Current file position
  686. ioFCBVRefNum      EQU         $34                       ; Volume refNum
  687. ioFCBClpSiz       EQU         $36                       ; File clump size
  688. ioFCBParID        EQU         $3A                       ; Parent directory ID
  689. ioFCBQElSize      EQU         $3E                       ; extended size of FCBPBRec
  690.  
  691. ; fields for _GetWDInfo:
  692.  
  693. ioWDIndex         EQU         $1A                       ; Working Directory index for _GetWDInfo
  694. ioWDProcID        EQU         $1C                       ; WD's ProcID (long)
  695. ioWDVRefNum       EQU         $20                       ; WD's Volume RefNum (word)
  696. ioWDDirID         EQU         $30                       ; WD's DirID (long)
  697.  
  698. ; fields for _FSControl call:
  699.  
  700. ioFSVrsn          EQU         $20                       ; File system version
  701.  
  702. ; field for CatMove
  703.  
  704. ioNewDirID        EQU         $24                       ; destination directory for CatMove
  705.  
  706. ; fields for GetLogInInfo
  707.  
  708. ioObjNamePtr    EQU            $1C                        ; pointer to buffer for name of log-in
  709.  
  710. ; fields for GetDirAccess and SetDirAccess
  711.  
  712. ioACOwnerID        EQU            $24                        ; owner field of parameter block
  713. ioACGroupID        EQU            $28                        ; group field of parameter block
  714. ioACAccess        EQU            $2C                        ; access privileges
  715.  
  716. ; values of user IDs and group IDs
  717.  
  718. noUser            EQU            0                        ; no user
  719. administratorUser    EQU        1                        ; administrator’s user number
  720. noGroup            EQU            0                        ; no group
  721.  
  722. ; values of access privileges
  723.  
  724. fullPrivileges    EQU            $00070007                ; all privileges for everybody and owner
  725. ownerPrivileges EQU            $00000007                ; all privileges for owner only
  726.                 
  727. ; Specific fields for CatSearch
  728.  
  729. ioMatchPtr        EQU        $18                    ; match buffer pointer
  730. ioReqMatchCount EQU        $1C                    ; maximum match count
  731. ioActMatchCount EQU        $20                    ; actual match count
  732. ioSearchBits    EQU        $24                    ; search criteria selector
  733. ioSearchInfo1    EQU        $28                    ; search values and range lower bounds
  734. ioSearchInfo2    EQU        $2C                    ; search values and range upper bounds
  735. ioSearchTime    EQU        $30                    ; length of time to run search
  736. ioCatPosition    EQU        $34                    ; catalog position information
  737. ioOptBuffer        EQU        $44                    ; optional read buffer
  738. ioOptBufSize    EQU        $48                    ; length of optional read buffer
  739.  
  740. ; Specific fields for FileID calls
  741.  
  742. ioNamePtr         EQU        $12                    ; name ptr of file 
  743. ioDestNamePtr    EQU        $1C                 ; name ptr of destination file (FIDExchangeFiles only)
  744. ioDestDirID        EQU        $24                    ; directory id of destination file (FIDExchangeFiles only)
  745. ioSrcDirID      EQU        $30                    ; directory id of file specified. 
  746. ioFileID        EQU        $36                    ; file id of file
  747.  
  748. ; Specific fields for Get/SetForeignPrivs
  749. ioForeignPrivInfo1    EQU        $2C
  750. ioForeignPrivInfo2    EQU        $30
  751. ioForeignPrivInfo3    EQU        $34
  752. ioForeignPrivInfo4    EQU        $38
  753.  
  754. ; specific fields for MakeFSSpec
  755. ioFSSpecPtr            EQU        $1C
  756.  
  757. ; Specific fields for device _Open
  758.  
  759. ioMix             EQU         $1C                       ; General purpose field imported by driver[long]
  760. ioFlags           EQU         $20                       ; General purpose flags [word]
  761. ioSlot            EQU         $22                       ; Slot [byte]
  762. ioId              EQU         $23                       ; Id [byte]
  763. ioSEBlkPtr        EQU         $22                       ; Pointer to the seBlock [long]
  764.  
  765. ; ioFlags:
  766. fMulti            EQU         $00                       ; b0 = fMulti: ioSEBlkPtr is valid (ioSlot, ioId are invalid)
  767.  
  768. ; Specific fields for _Control, _Status
  769.  
  770. csCode            EQU         $1A                       ; control/status code [word]
  771. csParam           EQU         $1C                       ; operation-defined parameters [22 bytes]
  772.  
  773. ; FInfo (Finder Information) record layout
  774.  
  775. fdType            EQU         $0                        ; type of file [long]
  776. fdCreator         EQU         $4                        ; file's creator [long]
  777. fdFlags           EQU         $8                        ; flags [word]
  778. fdLocation        EQU         $A                        ; file's location [point]
  779. fdFldr            EQU         $E                        ; file's window [word]
  780.  
  781. ; added for HFS
  782.  
  783. ; FXInfo record layout
  784.  
  785. fdIconID          EQU         $0                        ; Icon ID [word]
  786. fdUnused          EQU         $2                        ; unused but reserved [3 words]
  787. fdScript        EQU            $8                        ; script flag and number [byte]
  788. fdXFlags        EQU            $9                        ; more flags bits [byte]
  789. fdComment         EQU         $A                        ; Comment ID [word]
  790. fdPutAway         EQU         $C                        ; Home Dir ID [2 words]
  791.  
  792. ; DInfo record layout
  793.  
  794. frRect            EQU         $0                        ; Folder Rect [4 words]
  795. frFlags           EQU         $8                        ; Flags [word]
  796. frLocation        EQU         $A                        ; Location [2 words]
  797. frView            EQU         $E                        ; Folder view [word]
  798.  
  799. ; DXInfo record layout
  800.  
  801. frScroll          EQU         $0                        ; scroll position [2 words]
  802. frOpenChain       EQU         $4                        ; dirID chain of open folders [2 words]
  803. frScript        EQU            $8                        ; script flag and number [byte]
  804. frXFlags        EQU            $9                        ; more flags bits [byte]
  805. frComment         EQU         $A                        ; comment [word]
  806. frPutAway         EQU         $C                        ; Dir ID [2 words]
  807.  
  808. ;end of addition
  809.  
  810. ; Masks for fdFlags field of FInfo record defined above
  811.  
  812. fOnDesk           EQU         1
  813. fHasBundle        EQU         8192                      ; set if file has a bundle
  814. fInvisible        EQU         16384                     ; set if file's icon is invisible
  815. fTrash            EQU         -3                        ; file is in Trash window
  816. fDeskTop          EQU         -2                        ; file is on desktop
  817. fDisk             EQU         0                         ; file is in disk window
  818.  
  819. ; File System Globals
  820.  
  821. DrvQHdr           EQU         $308                      ; queue header of drives in system [10 bytes]
  822. BootDrive         EQU         $210                      ; drive number of boot drive [word]
  823. EjectNotify       EQU         $338                      ; eject notify procedure [pointer]
  824. IAZNotify         EQU         $33C                      ; world swaps notify procedure [pointer]
  825. SFSaveDisk        EQU         $214                      ; last vRefNum seen by standard file [word]
  826. CurDirStore       EQU         46+$36A                   ; save dir across calls to Standard File [long]
  827.  
  828.  
  829. ;+ Date-Time record (for use with _Secs2Date, and _Date2Secs)
  830.  
  831. DateTimeRec     RECORD        0                        ; moved here from ScriptEqu.a <04/23/89 pke>
  832. year            DS.W        1
  833. month            DS.W        1
  834. day             DS.W        1
  835. hour            DS.W        1
  836. minute            DS.W        1
  837. second            DS.W        1
  838. dayOfWeek        DS.W        1
  839. DateTimeRecSize    EQU            *
  840. size            EQU            *
  841.                 ENDR
  842.  
  843. dtYear            EQU         $0                        ; year (1904..) [word]
  844. dtMonth           EQU         $2                        ; month (1..12) [word]
  845. dtDay             EQU         $4                        ; day (1..31) [word]
  846. dtHour            EQU         $6                        ; hour (0..23) [word]
  847. dtMinute          EQU         $8                        ; minute (0..59) [word]
  848. dtSecond          EQU         $A                        ; second (0..59) [word]
  849. dtDayOfWeek       EQU         $C                        ; day of week, sunday..saturday (1..7) [word]
  850.  
  851.  
  852. ;+ Miscellaneous stuff
  853.  
  854. OneOne            EQU         $A02                      ; constant $00010001 [long]
  855. MinusOne          EQU         $A06                      ; constant $FFFFFFFF [long]
  856. Lo3Bytes          EQU         $31A                      ; constant $00FFFFFF [long]
  857. ROMBase           EQU         $2AE                      ; ROM base address [pointer]
  858. RAMBase           EQU         $2B2                      ; RAM base address [pointer]
  859. SysVersion        EQU         $15A                      ; version # of RAM-based system [word]
  860. RndSeed           EQU         $156                      ; random seed/number [long]
  861.  
  862. ; fields for _GetDefaultStartup: [DefStartRec]
  863. ; SlotDev:
  864. sdExtDevID        EQU         $0                        ; [byte]
  865. sdPartition       EQU         $1                        ; [byte]
  866. sdSlotNum         EQU         $2                        ; [byte]
  867. sdSRsrcID         EQU         $3                        ; [byte]
  868. ; SCSIDev:
  869. sdReserved1       EQU         $0                        ; [byte]
  870. sdReserved2       EQU         $1                        ; [byte]
  871. sdRefNum          EQU         $2                        ; [word]
  872.  
  873. ; fields for _GetVideoDefault: [DefVideoRec]
  874.  
  875. sdSlot            EQU         $0                        ; [byte]
  876. sdSResource       EQU         $1                        ; [byte]
  877.  
  878. ; fields for _GetOSDefault: [DefOSRec]
  879.  
  880. sdReserved        EQU         $0                        ; [byte]
  881. sdOSType          EQU         $1                        ; [byte]
  882.  
  883.  
  884. ;+ Machine Name Resource
  885. nameRsrcID        EQU            -16395                    ; STR# rsrc in System file containing
  886.                                                     ; machine names.
  887.  
  888. ;+ SysEnvirons info
  889.  
  890.  
  891. SysEnvRec         RECORD      0
  892. environsVersion DS.W        1
  893. machineType       DS.W        1
  894. systemVersion     DS.W        1
  895. processor         DS.W        1
  896. hasFPU            DS.B        1
  897. hasColorQD        DS.B        1
  898. keyBoardType      DS.W        1
  899. atDrvrVersNum     DS.W        1
  900. sysVRefNum        DS.W        1
  901.                   ALIGN       2
  902. sysEnv1Size       EQU         *-SysEnvRec               ; size for version 1
  903. size            EQU            *
  904.                   ENDR
  905.  
  906. curSysEnvVers     EQU         2                         ; latest SysEnvirons version
  907.  
  908. ; return values
  909.  
  910. envXL             EQU         -2                        ; for the glue (double sigh)
  911. envMac            EQU         -1                        ; for the glue (sigh)
  912. envMachUnknown    EQU         0
  913. env512KE          EQU         1
  914. envMacPlus        EQU         2
  915. envSE             EQU         3
  916. envMacII          EQU         4
  917. envMacIIx          EQU         5
  918. envMacIIcx         EQU         6
  919. envSE30           EQU         7
  920. envPortable        EQU            8
  921. envMacIIci        EQU            9
  922. envMacIIfx        EQU            11
  923.  
  924. envCPUUnknown     EQU         0                         ; CPU types
  925. env68000          EQU         1
  926. env68010          EQU         2
  927. env68020          EQU         3
  928. env68030          EQU         4
  929. env68040        EQU            5                        ; <4.8>
  930.  
  931. envUnknownKbd     EQU         0                         ; Keyboard types
  932. envMacKbd         EQU         1
  933. envMacAndPad      EQU         2
  934. envMacPlusKbd     EQU         3
  935. envAExtendKbd     EQU         4
  936. envStandADBKbd    EQU         5
  937. envPrtblADBKbd    EQU            6                        ; <4.9>
  938. envPrtblISOKbd    EQU            7
  939. envStdISOADBKbd    EQU            8
  940. envExtISOADBKbd    EQU            9
  941.  
  942.  
  943. ;+ Scratch Areas
  944.  
  945. Scratch20         EQU         $1E4                      ; scratch [20 bytes]
  946. Scratch8          EQU         $9FA                      ; scratch [8 bytes]
  947.  
  948.  
  949. ;+ Scrap Manager
  950.  
  951. ScrapSize         EQU         $960                      ; scrap length [long]
  952. ScrapHandle       EQU         $964                      ; memory scrap [handle]
  953. ScrapCount        EQU         $968                      ; validation byte [word]
  954. ScrapState        EQU         $96A                      ; scrap state [word]
  955. ScrapName         EQU         $96C                      ; pointer to scrap name [pointer]
  956.  
  957. ScrapStuff        RECORD        0
  958. scrapSize        DS.L        1                        ; long
  959. scrapHandle        DS.L        1                        ; Handle
  960. scrapCount        DS.W        1                        ; short
  961. scrapState        DS.W        1                        ; short
  962. scrapName        DS.L        1                        ; StringPtr
  963. size            EQU            *
  964.                 ENDR
  965.  
  966.  
  967. ;+ Desk Accessories
  968.  
  969.  
  970. ; Message Definitions (in CSCode of control call)
  971.  
  972. accEvent          EQU         $40                       ; event message from SystemEvent
  973. accRun            EQU         $41                       ; run message from SystemTask
  974. accCursor         EQU         $42                       ; cursor message from SystemTask
  975. accMenu           EQU         $43                       ; menu message from SystemMenu
  976. accUndo           EQU         $44                       ; undo message from SystemEdit
  977. accCut            EQU         $46                       ; cut message from SystemEdit
  978. accCopy           EQU         $47                       ; copy message from SystemEdit
  979. accPaste          EQU         $48                       ; paste message from SystemEdit
  980. accClear          EQU         $49                       ; clear message from SystemEdit
  981. goodBye           EQU         -1                        ; goodbye message
  982.  
  983.  
  984.                   IF          wholeSystem=1 THEN
  985.  
  986. ;International stuff
  987.  
  988. IntlSpec          EQU         $BA0                      ; (long) - ptr to extra Intl data
  989.  
  990. ;Switcher
  991.  
  992. SwitcherTPtr      EQU         $286                      ; Switcher's switch table
  993.  
  994. ; Trap bits for memory manager
  995.  
  996. tSysOrCurZone     EQU         10                        ; bit set implies System Zone
  997. ; bit clear implies Current Zone
  998. clearBit          EQU         9                         ; bit set means clear allocated memory.
  999.  
  1000.  
  1001. ; Peripheral chips and Magic Hardware addresses
  1002.  
  1003. CPUFlag           EQU         $12F                      ; $00=68000, $01=68010, $02=68020 (old ROM inits to $00)
  1004. cpu68000        EQU            0
  1005. cpu68010        EQU            1
  1006. cpu68020        EQU            2
  1007. cpu68030        EQU            3
  1008. cpu68040        EQU            4
  1009.  
  1010. ; VIA (6522) interface chip
  1011.  
  1012. VIA               EQU         $1D4                      ; VIA base address [pointer]
  1013.  
  1014. ; Disk Address
  1015.  
  1016. IWM               EQU         $1E0                      ; IWM base address [pointer]
  1017.  
  1018.  
  1019. ; Interrupt secondary vectors
  1020.  
  1021. Lvl1DT            EQU         $192                      ; Interrupt level 1 dispatch table [32 bytes]
  1022. Lvl2DT            EQU         $1B2                      ; Interrupt level 2 dispatch table [32 bytes]
  1023. ExtStsDT          EQU         $2BE                      ; SCC ext/sts secondary dispatch table [16 bytes]
  1024.  
  1025.  
  1026.  
  1027. ; Parameter Ram
  1028.  
  1029. SPValid           EQU         $1F8                      ; validation field ($A7) [byte]
  1030. SPATalkA          EQU         $1F9                      ; AppleTalk node number hint for port A
  1031. SPATalkB          EQU         $1FA                      ; AppleTalk node number hint for port B
  1032. SPAlarm           EQU         $200                      ; alarm time [long]
  1033. SPFont            EQU         $204                      ; default application font number minus 1 [word]
  1034. SPKbd             EQU         $206                      ; kbd repeat thresh in 4/60ths [2 4-bit]
  1035. SPPrint           EQU         $207                      ; print stuff [byte]
  1036. SPVolCtl          EQU         $208                      ; volume control [byte]
  1037. SPClikCaret       EQU         $209                      ; double click/caret time in 4/60ths[2 4-bit]
  1038. SPMisc1           EQU         $20A                      ; miscellaneous [1 byte]
  1039. SPMisc2           EQU         $20B                      ; miscellaneous [1 byte]
  1040. GetParam          EQU         $1E4                      ; system parameter scratch [20 bytes]
  1041. SysParam          EQU         $1F8                      ; system parameter memory [20 bytes]
  1042.  
  1043. ; Cursor
  1044.  
  1045. CrsrThresh        EQU         $8EC                      ; delta threshold for mouse scaling [word]
  1046. JCrsrTask         EQU         $8EE                      ; address of CrsrVBLTask [long]
  1047. MTemp             EQU         $828                      ; Low-level interrupt mouse location [long]
  1048. RawMouse          EQU         $82C                      ; un-jerked mouse coordinates [long]
  1049. CrsrRect          EQU         $83C                      ; Cursor hit rectangle [8 bytes]
  1050. TheCrsr           EQU         $844                      ; Cursor data, mask & hotspot [68 bytes]
  1051. CrsrAddr          EQU         $888                      ; Address of data under cursor [long]
  1052. CrsrSave          EQU         $88C                      ; data under the cursor [64 bytes]
  1053. CrsrVis           EQU         $8CC                      ; Cursor visible? [byte]
  1054. CrsrBusy          EQU         $8CD                      ; Cursor locked out? [byte]
  1055. CrsrNew           EQU         $8CE                      ; Cursor changed? [byte]
  1056. CrsrState         EQU         $8D0                      ; Cursor nesting level [word]
  1057. CrsrObscure       EQU         $8D2                      ; Cursor obscure semaphore [byte]
  1058.  
  1059. ; Mouse/Keyboard
  1060.  
  1061. KbdVars           EQU         $216                      ; Keyboard manager variables [4 bytes]
  1062. KbdType           EQU         $21E                      ; keyboard model number [byte]
  1063. MBState           EQU         $172                      ; current mouse button state [byte]
  1064. KeyMap            EQU         $174                      ; bitmap of the keyboard [2 longs]
  1065. KeypadMap         EQU         $17C                      ; bitmap for numeric pad-18bits [long]
  1066. Key1Trans         EQU         $29E                      ; keyboard translator procedure [pointer]
  1067. Key2Trans         EQU         $2A2                      ; numeric keypad translator procedure [pointer]
  1068. JGNEFilter        EQU         $29A                      ; GetNextEvent filter proc [pointer]
  1069. KeyMVars          EQU         $B04                      ; (word) for ROM KEYM proc state
  1070. Mouse             EQU         $830                      ; processed mouse coordinate [long]
  1071. CrsrPin           EQU         $834                      ; cursor pinning rectangle [8 bytes]
  1072. CrsrCouple        EQU         $8CF                      ; cursor coupled to mouse? [byte]
  1073. CrsrScale         EQU         $8D3                      ; cursor scaled? [byte]
  1074. MouseMask         EQU         $8D6                      ; V-H mask for ANDing with mouse [long]
  1075. MouseOffset       EQU         $8DA                      ; V-H offset for adding after ANDing [long]
  1076.  
  1077. ; System Clocks
  1078.  
  1079. AlarmState        EQU         $21F                      ; Bit7=parity, Bit6=beeped, Bit0=enable [byte]
  1080.  
  1081.  
  1082. ;+ Vertical Blanking Interrupt Handler
  1083.  
  1084. ; VBL Block Queue Element
  1085.  
  1086. vType             EQU         1                         ; VBL queue element is type 1
  1087. inVbl             EQU         6                         ; bit index for "in VBL" flag
  1088. vblink            EQU         0                         ; Link to next element [pointer]
  1089. vblType           EQU         4                         ; Unique ID for validity [word]
  1090. vblAddr           EQU         6                         ; service routine [pointer]
  1091. vblCount          EQU         $A                        ; timeout count [word]
  1092. vblPhase          EQU         $C                        ; phase count [word]
  1093. VBLQueue          EQU         $160                      ; VBL queue header [10 bytes]
  1094.  
  1095. ; Event manager
  1096.  
  1097. jPlayCtl          EQU         16                        ; playBack call
  1098. jRecordCtl        EQU         17                        ; record call
  1099. jcTickCount       EQU         0                         ; journal code for TickCount
  1100. jcGetMouse        EQU         1                         ; journal code for GetMouse
  1101. jcButton          EQU         2                         ; journal code for Button
  1102. jcGetKeys         EQU         3                         ; journal code for GetKeys
  1103. jcEvent           EQU         4                         ; journal code for GetNextEvent(Avail)
  1104. SysEvtMask        EQU         $144                      ; system event mask [word]
  1105. SysEvtBuf         EQU         $146                      ; system event queue element buffer [pointer]
  1106. EventQueue        EQU         $14A                      ; event queue header [10 bytes]
  1107. EvtBufCnt         EQU         $154                      ; max number of events in SysEvtBuf - 1 [word]
  1108.  
  1109. ; Event Queue Element Data Stucture
  1110.  
  1111. evtQWhat          EQU         6                         ; event code [word]
  1112. evtQMessage       EQU         8                         ; event message [long]
  1113. evtQWhen          EQU         $C                        ; ticks since startup [long]
  1114. evtQWhere         EQU         $10                       ; mouse location [long]
  1115. evtQMeta          EQU         $14                       ; state of modifier keys [byte]
  1116. evtQMBut          EQU         $15                       ; state of mouse button [byte]
  1117. evtQBlkSize       EQU         $16                       ; size of event record counting queue info
  1118.  
  1119. ; flags in flags field in heapzone header
  1120.  
  1121. fOnCheck          EQU         0                         ; Turn On Checking
  1122. fChecking         EQU         1                         ; Checking on
  1123. fNSelCompct       EQU         4                         ; Use non-selective compact algorithm when 1.
  1124. fNoRvrAlloc       EQU         5                         ; Don't use rover allocation scheme when 1.
  1125. fNSelPurge        EQU         6                         ; Use non-selective purge algorithm when 1.
  1126. fRelAtEnd         EQU         7                         ; MakeBk packs rels at end of free bk when 1.
  1127. ROZ               EQU         $0                        ; bit in flags field of MemMgr zone header
  1128.  
  1129. ; Block Types
  1130.  
  1131. tybkMask          EQU         3                         ; Mask for block type
  1132. tybkFree          EQU         0                         ; Free Block
  1133. tybkNRel          EQU         1                         ; Non-Relocatable
  1134. tybkRel           EQU         2                         ; Relocatable
  1135.  
  1136. ; Block Offsets
  1137.  
  1138. tagBC             EQU         0                         ; Tag and Byte Count field [long]
  1139. handle            EQU         4                         ; back pointer to master pointer [pointer]
  1140. blkData           EQU         8                         ; data starts here
  1141.  
  1142. ; Heap Zone header
  1143.  
  1144. bkLim             EQU         $0                        ; last block in zone [pointer]
  1145. purgePtr          EQU         $4                        ; roving purge placeholder [pointer]
  1146. hFstFree          EQU         $8                        ; first free handle [pointer]
  1147. zcbFree           EQU         $C                        ; # of free bytes in zone [long]
  1148. gzProc            EQU         $10                       ; grow zone procedure [pointer]
  1149. mAllocCnt         EQU         $14                       ; # of master ptrs to allocate [word]
  1150. flags             EQU         $16                       ; Flags [word]
  1151. cntRel            EQU         $18                       ; # of allocated relocatable blocks [word]
  1152. maxRel            EQU         $1A                       ; max # of allocated rel. blocks [word]
  1153. cntNRel           EQU         $1C                       ; # of allocated non-rel. blocks [word]
  1154. maxNRel           EQU         $1E                       ; max # of allocated non-rel. blocks [word]
  1155. cntEmpty          EQU         $20                       ; # of empty handles [word]
  1156. cntHandles        EQU         $22                       ; total # of handles [word]
  1157. minCBFree         EQU         $24                       ; min # of bytes free [long]
  1158. purgeProc         EQU         $28                       ; purge warning procedure [pointer]
  1159. allocPtr          EQU         $30                       ; roving allocator [pointer]
  1160. heapData          EQU         $34                       ; start of heap zone data
  1161.  
  1162.  
  1163.  
  1164. GZRootHnd         EQU         $328                      ; root handle for GrowZone [handle]
  1165. GZRootPtr         EQU         $32C                      ; root pointer for GrowZone [pointer]
  1166. GZMoveHnd         EQU         $330                      ; moving handle for GrowZone [handle]
  1167. MemTop            EQU         $108                      ; top of memory [pointer]
  1168. MmInOK            EQU         $12E                      ; initial memory mgr checks ok? [byte]
  1169. HpChk             EQU         $316                      ; heap check RAM code [pointer]
  1170. MaskBC            EQU         $31A                      ; Memory Manager Byte Count Mask [long]
  1171. MaskHandle        EQU         $31A                      ; Memory Manager Handle Mask [long]
  1172. MaskPtr           EQU         $31A                      ; Memory Manager Pointer Mask [long]
  1173. MinStack          EQU         $31E                      ; min stack size used in InitApplZone [long]
  1174. DefltStack        EQU         $322                      ; default size of stack [long]
  1175. MMDefFlags        EQU         $326                      ; default zone flags [word]
  1176.  
  1177. ;+ System Error Handler
  1178.  
  1179. DSAlertTab        EQU         $2BA                      ; system error alerts [pointer]
  1180. DSAlertRect       EQU         $3F8                      ; rectangle for disk-switch alert [8 bytes]
  1181. DSDrawProc        EQU         $334                      ; alternate syserror draw procedure [pointer]
  1182. DSWndUpdate       EQU         $15D                      ; GNE not to paintBehind DS AlertRect? [byte]
  1183. WWExist           EQU         $8F2                      ; window manager initialized? [byte]
  1184. QDExist           EQU         $8F3                      ; quickdraw is initialized [byte]
  1185. ResumeProc        EQU         $A8C                      ; Resume procedure from InitDialogs [pointer]
  1186. DSErrCode         EQU         $AF0                      ; last system error alert ID
  1187.  
  1188. ;+ Drivers
  1189.  
  1190. dskRfN            EQU         $FFFB                     ; 3.5" disk reference number
  1191. IntFlag           EQU         $15F                      ; reduce interrupt disable time when bit 7 = 0
  1192.  
  1193. ; Serial I/O Driver
  1194.  
  1195. SerialVars        EQU         $2D0                      ; async driver variables [16 bytes]
  1196. ABusVars          EQU         $2D8                      ; Pointer to AppleTalk local variables
  1197. ABusDCE           EQU         $2DC                      ; Pointer to AppleTalk DCE
  1198. PortAUse          EQU         $290                      ; bit 7: 1 = not in use, 0 = in use
  1199. ; bits 0-3: current use of port (see use type)
  1200. ; bits 4-6: user specific
  1201. PortBUse          EQU         $291                      ; port B use, same format as PortAUse
  1202. SCCASts           EQU         $2CE                      ; SCC read reg 0 last ext/sts rupt - A [byte]
  1203. SCCBSts           EQU         $2CF                      ; SCC read reg 0 last ext/sts rupt - B [byte]
  1204.  
  1205. ; Serial handshake record definition
  1206.  
  1207. shFXOn            EQU         $0                        ; XOn/XOff output control flags [byte]
  1208. shFCTS            EQU         $1                        ; CTS hardware handshake flag [byte]
  1209. shXOn             EQU         $2                        ; XOn character [byte]
  1210. shXOff            EQU         $3                        ; XOff character [byte]
  1211. shErrs            EQU         $4                        ; errors that cause abort [byte]
  1212. shEvts            EQU         $5                        ; status changes that cause events [byte]
  1213. shFInX            EQU         $6                        ; XOn/XOff input flow control flag [byte]
  1214. shNull            EQU         $7                        ; not used [byte]
  1215.  
  1216. ; Serial status record definition
  1217.  
  1218. ssCumErrs         EQU         $0                        ; cumulative errors [byte]
  1219. ssXOffSent        EQU         $1                        ; XOff sent as input control flag [byte]
  1220. ssRdPend          EQU         $2                        ; read pending flag [byte]
  1221. ssWrPend          EQU         $3                        ; write pending flag [byte]
  1222. ssCTSHold         EQU         $4                        ; CTS flow control hold flag [byte]
  1223. ssXOffHold        EQU         $5                        ; XOff received as output flow control [byte]
  1224.  
  1225. ; Disk Driver
  1226.  
  1227. ; Driver Code Header (for I/O drivers, desk accessories)
  1228.  
  1229. drvrFlags         EQU         $0                        ; various flags and permissions [word]
  1230. drvrDelay         EQU         $2                        ; # of ticks between systask calls [word]
  1231. drvrEMask         EQU         $4                        ; event mask [word]
  1232. drvrMenu          EQU         $6                        ; driver menu ID [word]
  1233. drvrOpen          EQU         $8                        ; open routine offset [word]
  1234. drvrPrime         EQU         $A                        ; prime routine offset [word]
  1235. drvrCtl           EQU         $C                        ; control routine offset [word]
  1236. drvrStatus        EQU         $E                        ; status routine offset [word]
  1237. drvrClose         EQU         $10                       ; warmstart reset routine offset [word]
  1238. drvrName          EQU         $12                       ; length byte and name of driver [string]
  1239. ;drvrVersion EQU ??? ; Driver w/ highest version # installed [word]
  1240. ; This field's offset varies depending upon the length
  1241. ; of the Name field preceding it. It must be word aligned!
  1242.  
  1243. ; Driver Status record definition
  1244.  
  1245. dsTrack           EQU         $0                        ; current track [word]
  1246. dsWriteProt       EQU         $2                        ; bit 7=1 if volume locked [byte]
  1247. dsDiskInPlace     EQU         $3                        ; disk in place [byte]
  1248. dsInstalled       EQU         $4                        ; drive installed [byte]
  1249. dsSides           EQU         $5                        ; bit 7=0 if single-sided drive [byte]
  1250. dsQLink           EQU         $6                        ; next queue entry [pointer]
  1251. dsDQVers          EQU         $A                        ; 1 for HD20 [word]
  1252. dsDQDrive         EQU         $C                        ; drive number [word]
  1253. dsDQRefNum        EQU         $E                        ; driver reference number [word]
  1254. dsDQFSID          EQU         $10                       ; file-system identifier [word]
  1255. dsTwoSideFmt      EQU         $12                       ; -1 if two-sided disk [byte]
  1256. dsDiskErrs        EQU         $14                       ; error count [word]
  1257. dsDrvSize         EQU         $12                       ; drive block size low word [word]
  1258. dsDrvS1           EQU         $14                       ; drive block size high word [word]
  1259. dsDrvType         EQU         $16                       ; 1 for HD20 [word]
  1260. dsDrvManf         EQU         $18                       ; 1 for Apple Computer, Inc [word]
  1261. dsDrvChar         EQU         $1A                       ; 230 ($E6) for HD20 [word]
  1262. dsDrvMisc         EQU         $1C                       ; 0 -- reserved [byte]
  1263.  
  1264.  
  1265. DskErr            EQU         $142                      ; disk routine result code [word]
  1266. PWMBuf2           EQU         $312                      ; PWM buffer 1 (or 2 if sound) [pointer]
  1267.  
  1268. ; Drive command codes
  1269.  
  1270. dcRead            EQU         0
  1271. dcWrite           EQU         1
  1272. dcStatus          EQU         3
  1273. dcInit            EQU         25
  1274. dcScan            EQU         26
  1275.  
  1276. ; Sound Stuff
  1277.  
  1278. SoundPtr          EQU         $262                      ; 4VE sound definition table [pointer]
  1279. SoundBase         EQU         $266                      ; sound bitMap [pointer]
  1280. SoundVBL          EQU         $26A                      ; vertical retrace control element [16 bytes]
  1281. SoundDCE          EQU         $27A                      ; sound driver DCE [pointer]
  1282. SoundActive       EQU         $27E                      ; sound is active? [byte]
  1283. SoundLevel        EQU         $27F                      ; current level in buffer [byte]
  1284. CurPitch          EQU         $280                      ; current pitch value [word]
  1285.  
  1286. ; I/O System
  1287.  
  1288. noQueueBit        EQU         $9                        ; tells I/O system not to queue the request
  1289. asyncTrpBit       EQU         $A                        ; bit in high byte of trap specifying async
  1290. ToExtFS           EQU         $3F2                      ; hook for external file systems
  1291.  
  1292. ; File System Globals
  1293.  
  1294. DskVerify         EQU         $12C                      ; used by 3.5 disk driver for read/verify [byte]
  1295. TagData           EQU         $2FA                      ; sector tag info for disk drivers [14 bytes]
  1296. BufTgFNum         EQU         $2FC                      ; file number [long]
  1297. BufTgFFlg         EQU         $300                      ; flags [word]
  1298. BufTgFBkNum       EQU         $302                      ; logical block number [word]
  1299. BufTgDate         EQU         $304                      ; time stamp [word]
  1300.  
  1301. ; I/O Command Equates for I/O Queue Elements (match trap numbers)
  1302.  
  1303. aRdCmd            EQU         2                         ; read command
  1304. aWrCmd            EQU         3                         ; write command
  1305. aCtlCmd           EQU         4                         ; control command
  1306. aStsCmd           EQU         5                         ; status command
  1307.  
  1308. ; fields for _SetPMSP call: PMSP = "Poor Man's Search Path"
  1309.  
  1310. ioPMSPFlg         EQU         $1A                       ; Flag whether to enable the PMSP
  1311. ioPMSPHook        EQU         $1C                       ; Pointer to PMSP hook proc
  1312.  
  1313. ; Print variables
  1314.  
  1315. ScrDmpEnb         EQU         $2F8                      ; screen dump enabled? [byte]
  1316. ScrDmpType        EQU         $2F9                      ; FF dumps screen, FE dumps front window [byte]
  1317.  
  1318. ; Scrap Variables
  1319.  
  1320. ScrapVars         EQU         $960                      ; scrap manager variables [32 bytes]
  1321. ScrapInfo         EQU         $960                      ; scrap length [long]
  1322. ScrapEnd          EQU         $980                      ; end of scrap vars
  1323. ScrapTag          EQU         $970                      ; scrap file name [STRING[15]]
  1324.  
  1325. ; Segment Loader
  1326.  
  1327. LaunchFlag        EQU         $902                      ; from launch or chain [byte]
  1328. SaveSegHandle     EQU         $930                      ; seg 0 handle [handle]
  1329. CurJTOffset       EQU         $934                      ; current jump table offset [word]
  1330. CurPageOption     EQU         $936                      ; current page 2 configuration [word]
  1331. LoaderPBlock      EQU         $93A                      ; param block for ExitToShell [10 bytes]
  1332. CurApRefNum       EQU         $900                      ; refNum of application's resFile [word]
  1333. CurrentA5         EQU         $904                      ; current value of A5 [pointer]
  1334. CurStackBase      EQU         $908                      ; current stack base [pointer]
  1335. CurApName         EQU         $910                      ; name of application [STRING[31]]
  1336. LoadTrap          EQU         $12D                      ; trap before launch? [byte]
  1337. SegHiEnable       EQU         $BB2                      ; (byte) 0 to disable MoveHHi in LoadSeg
  1338.  
  1339. ;device manager - Chooser message values
  1340.  
  1341. newSelMsg         EQU         12                        ; a new selection has been made
  1342. fillListMsg       EQU         13                        ; fill the list with choices to be made
  1343. getSelMsg         EQU         14                        ; mark one or more choices as selcted
  1344. selectMsg         EQU         15                        ; a choice has actually been made
  1345. deselectMsg       EQU         16                        ; a choice has been canceled
  1346. terminateMsg      EQU         17                        ; lets device package clean up
  1347. buttonMsg         EQU         19                        ; a button has been clicked
  1348. psAlert           EQU         6                         ; page setup alert bit in HiliteMode
  1349. theChooser        EQU         1
  1350.  
  1351. ; cdev message types
  1352. initDev           EQU         0                         ; Time for cdev to initialize itself
  1353. hitDev            EQU         1                         ; Hit on one of my items
  1354. closeDev          EQU         2                         ; Close yourself
  1355. nulDev            EQU         3                         ; Null event
  1356. updateDev         EQU         4                         ; Update event
  1357. activDev          EQU         5                         ; Activate event
  1358. deactivDev        EQU         6                         ; Deactivate event
  1359. keyEvtDev         EQU         7                         ; Key down/auto key
  1360. macDev            EQU         8                         ; Decide whether or not to show up
  1361. undoDev            EQU            9                        ; Edit menu undo  (cmd-z).
  1362. cutDev            EQU            10                        ; Edit menu cut   (cmd-x).
  1363. copyDev            EQU            11                        ; Edit menu copy  (cmd-c).
  1364. pasteDev        EQU            12                        ; Edit menu paste (cmd-v).
  1365. clearDev        EQU            13                        ; Edit menu clear.
  1366. cursorDev        EQU            14                        ; Cursor panel area.
  1367.  
  1368. ; Monitors control panel messages
  1369. initMsg            EQU            1                        ; initialization
  1370. okMsg            EQU            2                        ; user clicked OK button
  1371. cancelMsg        EQU            3                        ; user clicked Cancel button
  1372. hitMsg            EQU            4                        ; user clicked control in Options dialog
  1373. nulMsg            EQU            5                        ; periodic event
  1374. updateMsg        EQU            6                        ; update event
  1375. activateMsg        EQU            7                        ; not used
  1376. deactivateMsg    EQU            8                        ; not used
  1377. keyEvtMsg        EQU            9                        ; keyboard event
  1378. superMsg        EQU            10                        ; show superuser controls
  1379. normalMsg        EQU            11                        ; show only normal controls
  1380. startupMsg        EQU            12                        ; code has been loaded
  1381.  
  1382. ; cdev error codes
  1383. cdevGenErr        EQU         -1                        ; General error; gray cdev w/o alert
  1384. cdevMemErr        EQU         0                         ; Memory shortfall; alert user please
  1385. cdevResErr        EQU         1                         ; Couldn't get a needed resource; alert
  1386. cdevUnset         EQU         3                         ; cdevValue is initialized to this
  1387. ;___________________________________________________________________________
  1388. ;
  1389. ; Background Notification Manager
  1390.  
  1391. BNMQHd            EQU         $B60                      ; head of background notification Q
  1392.  
  1393. ;___________________________________________________________________________
  1394. ;
  1395. ; Communications Toolbox Globals Pointer
  1396.  
  1397. CommToolboxGlobals    EQU         $BB4                  ; [long] pointer to CTB Globals <8>
  1398.  
  1399.  
  1400. ;___________________________________________________________________________
  1401. ; Memory Manager
  1402.  
  1403. defaultPhysicalEntryCount EQU    8            ; default number of physical blocks in table
  1404.  
  1405. ; values returned from the GetPageState function
  1406.  
  1407. kPageInMemory          EQU            0
  1408. kPageOnDisk            EQU            1
  1409. kNotPaged              EQU            2
  1410.  
  1411. MemoryBlock            RECORD        0
  1412. address                DS.L        1            ; start of block
  1413. count                DS.L        1            ; size of block
  1414. size                EQU            *            ; size of MemoryBlock
  1415.                     ENDR
  1416.  
  1417. LogicalToPhysicalTable RECORD    0
  1418. logical                DS.B        MemoryBlock    ; logical block
  1419. physical            EQU            *            ; equivalent physical blocks
  1420. size                EQU            *            ; minimum size of table
  1421. defaultSize            EQU            size + (MemoryBlock.size * defaultPhysicalEntryCount)
  1422.                     ENDR
  1423.  
  1424. ;___________________________________________________________________________
  1425. ;
  1426.  
  1427. JDoEject          EQU         4*($F7)+$0400             ; Sony Driver jump vectors
  1428.  
  1429.  
  1430.                   ENDIF
  1431.  
  1432.     ENDIF    ; if not already included...